﻿using Raven.Client.Indexes;
using Raven.Database.Indexing;
using Raven.Client;
using System.Diagnostics;
using Raven.Abstractions.Indexing;
using Raven.Client.Connection;
using Raven.Client.Document;

namespace Crawler.DataAccess
{
    public abstract class OttoIndexCreationTask : AbstractIndexCreationTask
    {
        public override IndexDefinition CreateIndexDefinition()
        {
            return CreateIndex();
        } 

        public abstract IndexDefinition CreateIndex();

        public override void Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention)
        {
            base.Execute(databaseCommands, documentConvention);

            Trace.WriteLine(string.Format("'{0}' Index Executed", IndexName));
        }
    }
}
